<template>
	<button class="myBtn" :type="btnType" :loading="loading" :size='size' :style="style" @click="onclick">
		{{title}}
		<!-- <slot v-if="!title"/> -->
	</button>
</template>

<script>
	import {defineComponent,reactive,toRefs,onMounted,getCurrentInstance,computed} from 'vue'
	import {onLoad,onShow} from '@dcloudio/uni-app'
	import { useStore } from 'vuex'
	export default defineComponent({
		components:{
			
		},
		props:{
			title:'',
			loading:{
				type:Boolean,
				default:false
			},
			size:{
				type:String,
				default:'default'
			},
			style:'',
			btnType:{
				type:String,
				default:'primary'
			}
		},
		setup(props,context) {
			const store = useStore()
			const {proxy} = getCurrentInstance()
			
			const state = reactive({
				
			})
			
			onMounted(()=>{
				
			})
			
			const onclick = ()=>{
				if(props.loading) return ;
				proxy.$emit('click')
			}
			
			return {
				...toRefs(state),
				onclick
			}
		}
	})
</script>

<style lang="scss" scoped>
	.myBtn[type=primary]{
		background-color: #ddb851;
		height: 90rpx;
		line-height: 90rpx;
		font-size: 30rpx;
		border: 0;
		&::after{
			border: 0;
		}
	}
</style>